import time
from selenium import webdriver

# 打开浏览器,请求目标网址
driver = webdriver.Chrome()
driver.get('https://www.baidu.com')

# 添加登录需要的cookie
cookies = [
    {
        'name': 'BDUSS_BFESS',
        'value': 'WRTNXRhRk5JYzJzblJKQUpmaVNBODJodjNTaXNWR0RVcU5DRlhxYnhRT25VNnRpRVFBQUFBJCQAAAAAAQAAAAEAAAADMpgFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKfGg2KnxoNia'

    },
    {
        'name': 'BDUSS',
        'value': 'WRTNXRhRk5JYzJzblJKQUpmaVNBODJodjNTaXNWR0RVcU5DRlhxYnhRT25VNnRpRVFBQUFBJCQAAAAAAQAAAAEAAAADMpgFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKfGg2KnxoNia'
    }
]

# 添加cookies
driver.add_cookie(cookies[0])
driver.add_cookie(cookies[1])

# 刷新浏览器
driver.refresh()

#退出浏览器
time.sleep(10)
# driver.quit()
